package com.jl.jlapp.adapter;

import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.util.Log;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jl.jlapp.R;
import com.jl.jlapp.eneity.CouponMsgModel;

import java.util.List;

public class CouponGoodsListAdapter
        extends BaseQuickAdapter<CouponMsgModel.ResultDataBean.GoodsBean, BaseViewHolder> {
    public CouponGoodsListAdapter(@LayoutRes int paramInt, @Nullable List<CouponMsgModel.ResultDataBean.GoodsBean> paramList) {
        super(paramInt, paramList);
        Log.d("aaaaaa", "size:" + paramList.size());
    }

    protected void convert(BaseViewHolder paramBaseViewHolder, CouponMsgModel.ResultDataBean.GoodsBean paramGoodsBean) {
        paramBaseViewHolder.setText(R.id.goods_name, paramGoodsBean.getName() + " " + ((CouponMsgModel.ResultDataBean.GoodsBean.GoodsSpecificationDetailsBean) paramGoodsBean.getGoodsSpecificationDetails().get(0)).getSpecifications());
        paramBaseViewHolder.setText(R.id.goods_price, ((CouponMsgModel.ResultDataBean.GoodsBean.GoodsSpecificationDetailsBean) paramGoodsBean.getGoodsSpecificationDetails().get(0)).getPrice() + "");
        paramBaseViewHolder.setText(R.id.is_sale_num, paramGoodsBean.getSaleCount() + "");
        paramBaseViewHolder.setText(R.id.goods_id, paramGoodsBean.getId() + "");
        ImageView localImageView = (ImageView) paramBaseViewHolder.getView(R.id.goods_img);
        if (((CouponMsgModel.ResultDataBean.GoodsBean.GoodsSpecificationDetailsBean) paramGoodsBean.getGoodsSpecificationDetails().get(0)).getGoodsDisplayPictures().size() > 0) {
            String picUrl = ((CouponMsgModel.ResultDataBean.GoodsBean.GoodsSpecificationDetailsBean.GoodsDisplayPicturesBean) ((CouponMsgModel.ResultDataBean.GoodsBean.GoodsSpecificationDetailsBean) paramGoodsBean.getGoodsSpecificationDetails().get(0)).getGoodsDisplayPictures().get(0)).getPicUrl();
            Glide.with(paramBaseViewHolder.itemView.getContext()).asBitmap().apply(new RequestOptions().placeholder(R.drawable.img_noimg_xs).error(R.drawable.img_lose_xs)).load("http://117.158.178.202:8001/JLMIS/" + picUrl).into(localImageView);
        } else {
            paramBaseViewHolder.addOnClickListener(R.id.goods_list_add_shop_cart);
            Glide.with(paramBaseViewHolder.itemView.getContext()).asBitmap().apply(new RequestOptions().placeholder(R.drawable.img_noimg_xs).error(R.drawable.img_lose_xs)).load(R.drawable.img_noimg_xs).into(localImageView);
        }
    }
}


/* Location:              /Users/davidzhang/Documents/decompileApk/jlfood-dex2jar.jar!/com/jl/jlapp/adapter/CouponGoodsListAdapter.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */